//
//  CelloneTab4.m
//  project-A (pianke)
//
//  Created by dllo on 16/1/26.
//  Copyright © 2016年 scott. All rights reserved.
//

#import "CelloneTab4.h"
#import <DKNightVersion.h>
@implementation CelloneTab4

-(void)dealloc{
    [_labellei release];
    [_labelneirong release];
    [_labelsong release];
    [_lableby release];
    [_labelcount release];
    
    [_image release];
    [_zan release];
    [_buttonplay release];
    [super dealloc];
    
}

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self creatview];
    }
    return self;
}
-(void)creatview{
    self.labellei = [[UILabel alloc]init];
   
    [self.contentView addSubview:self.labellei];
    
     self.labellei.dk_textColorPicker = DKColorWithColors([UIColor blackColor], [UIColor whiteColor]);
    [self.labellei release];
    
    

    
    self.labelsong = [[UILabel alloc]init];
       [self.contentView addSubview:self.labelsong];
     self.labelsong.dk_textColorPicker = DKColorWithColors([UIColor blackColor], [UIColor whiteColor]);
    [self.labelsong release];
    
    self.lableby = [[UILabel alloc]init];
    [self.contentView addSubview:self.lableby];
    
     self.lableby.dk_textColorPicker = DKColorWithColors([UIColor blackColor], [UIColor whiteColor]);
    [self.lableby release];
    
    self.labelneirong = [[UILabel alloc]init];
   
     self.labelneirong.dk_textColorPicker = DKColorWithColors([UIColor blackColor], [UIColor whiteColor]);
    [self.contentView addSubview:self.labelneirong];
    [self.labelneirong release];
    
    self.labelcount = [[UILabel alloc]init];
      [self.contentView addSubview:self.labelcount];
     self.labelcount.dk_textColorPicker = DKColorWithColors([UIColor blackColor], [UIColor whiteColor]);
    
    [self.labelcount release];
    
    self.image = [[UIImageView alloc]init];
       [self.contentView addSubview:self.image];
    [self.image release];
    
    self.zan = [[UIImageView alloc]init];
     self.zan.image = [UIImage imageNamed:@"xin"];
        [self.contentView addSubview:self.zan];
    [self.zan release];
    
    
    self.buttonplay = [UIButton buttonWithType:UIButtonTypeSystem];
    [self.buttonplay setImage:[UIImage imageNamed:@"start"] forState:UIControlStateNormal];
    [self.contentView addSubview:self.buttonplay];
    [self.buttonplay addTarget:self action:@selector(play) forControlEvents:UIControlEventTouchUpInside];
    
}

-(void)play{
    
    
}


-(void)layoutSubviews{
    [super layoutSubviews];
    CGFloat width = self.contentView.frame.size.width;
//    CGFloat height = self.contentView.frame.size.height
    
    self.labellei.frame = CGRectMake(20, 20, 100, 15);
    self.labelsong.frame = CGRectMake(20, 55, 150, 20);
    self.lableby.frame = CGRectMake(20,85 , 80, 15);
    self.labelneirong.frame = CGRectMake(20, width / 4.0f+ 20 + 30, width - 40,90);
    
    self.zan.frame = CGRectMake(width - 100, width / 4.0f + 165, 20, 20);
    self.labelcount.frame = CGRectMake(width - 70, width / 4.0f + 165, 40, 20);
    
    self.image.frame = CGRectMake(width /3.0f * 2, 30, width /4.0f, width / 4.0f);
    self.buttonplay.frame = CGRectMake(0, 0, 40, 40);
    self.buttonplay.center = CGPointMake(19 * width / 24, width / 8.0f + 30);
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
